package ${toPackage!};

import epoch.game.db.annotation.BindTable;
import epoch.game.db.gamedb.Entity;

/**
 * ${clazzTitle!}
 * 
 * @author CodeGen
 *
 */
@BindTable(tableName = "${tableName!}"<#if (keyFiled)??>, pk = "${(keyFiled.fieldName)!}"</#if>)
public class ${clazzName!} extends Entity {

	public static final String TABLE_NAME = "${tableName!}";

	private static final long serialVersionUID = 1L;

	public ${clazzName!}() {

	}

<#list fieldList as item>
	/** ${(item.fieldComment)!} */
	public static final String ${(item.fieldName)!} = "${(item.fieldName)!}";
</#list> 

	@Override
	public String tableName() {
		return TABLE_NAME;
	}
<#list fieldList as item>

	public ${(item.type)!} get${(item.name)!}() {
		if (super.attrs.containsKey(${(item.fieldName)!})) {
			return (${(item.type)!}) super.attrs.get(${(item.fieldName)!});
		}
		return ${(item.returns)!};
	}

	public void set${(item.name)!}(${item.type} ${(item.fieldName)!}) {
		super.attrs.put(${clazzName!}.${(item.fieldName)!}, ${(item.fieldName)!});
	}
</#list>
}